import { SEntityId } from "../../../../Message/Public/SEntityId";
import { SpecialLoaderManager } from "../../../../com/gengine/resource/SpecialLoaderManager";
import { PathConst } from "../../../common/global/PathConst";
import { LoaderManager } from "../../../../com/gengine/resource/LoaderManager";
import { Log } from "../../../../com/gengine/debug/Log";
import { GImageBitmap } from "../../../../com/mui/controls/GImageBitmap";
import { ResConfig } from "../ResConfig";
import { BossConfig } from "../BossConfig";
import { ImagesConst } from "../ImagesConst";
type int = number;
//class AvatarInfo
    
    export  class AvatarInfo
    {
       

        public static getUpdateAvatar(arg1: SEntityId, arg2: int, arg3: Function=null): void
        {
            SpecialLoaderManager.Load("userImage_" + arg1.id + "_" + arg2, PathConst.headImagePath + arg1.id + "_" + arg2 + ".jpg", arg3);
            return;
        }

        public static getAvatar(arg1: int, arg2: int, arg3: int, arg4: Function, arg5: int=0): void
        {
            var loc1=AvatarInfo.getPlayerAvatarName(arg1, arg2, arg3, arg5);
            LoaderManager.instance.load(loc1, arg4);
            Log.system("AvatarInfo.getAvatar：" + loc1);
            return;
        }

        public static getPlayerAvatarName(arg1: int, arg2: int, arg3: int, arg4: int=0): string
        {
            var loc1=null;
            if (arg4 == 0) 
            {
                loc1 = "XianMeng";
                if (arg1 != 1) 
                {
                    if (arg1 != 2) 
                    {
                        if (arg1 == 3) 
                        {
                            loc1 = "LuoCha";
                        }
                    }
                    else 
                    {
                        loc1 = "CangQiong";
                    }
                }
                else 
                {
                    loc1 = "XianMeng";
                }
                return loc1 + "_" + arg2 + "_" + arg3 + ".png";
            }
            return arg4 + "_" + arg3.toString() + ".png";
        }

        public static createPlayerAvatar(arg1: int, arg2: int, arg3: int, arg4: int=0): GImageBitmap
        {
            return new GImageBitmap(AvatarInfo.getPlayerAvatarName(arg1, arg2, arg3, arg4));
        }

        public static getPlayerAvatarUrl(arg1: int, arg2: int, arg3: int, arg4: int=0): string
        {
            var loc1=AvatarInfo.getPlayerAvatarName(arg1, arg2, arg3, arg4);
            var loc2;
            if (loc2 = ResConfig.instance.getInfoByName(loc1 + ".png")) 
            {
                return loc2.path;
            }
            return "";
        }

        public static getBossAvatarName(arg1: int): string
        {
            var loc1=BossConfig.instance.getInfoByName(arg1);
            if (loc1) 
            {
                return loc1.avatarId + ".png";
            }
            return "";
        }

        public static getPicNameByCamp(arg1: int): string
        {
            var loc1="";
            if (arg1 != 1) 
            {
                if (arg1 != 2) 
                {
                    if (arg1 == 3) 
                    {
                        loc1 = ImagesConst.CampCang;
                    }
                }
                else 
                {
                    loc1 = ImagesConst.CampXing;
                }
            }
            else 
            {
                loc1 = ImagesConst.CampXiao;
            }
            return loc1;
        }
    }
